import UIKit

///
@available(iOS 13.0, *)
extension QKC where AA :UISearchTextField {
	/// Simple access to the collection of tokens.
    open func tokens_qk_s(_ tokens:  [UISearchToken]) -> QKC<AA,YY,ZZ, [UISearchToken]>{
		return link(next: tokens).then_QK { $0.value.tokens = tokens }
	}
    open func tokens_qk_g() -> QKC<AA,YY,ZZ, [UISearchToken]>{
		 self +^ self.value.tokens
	}

	/// @see -[<UITextInput> positionWithinRange:atCharacterOffset:]
    open func textualRange_qk_g() -> QKC<AA,YY,ZZ, UITextRange >{
		 self +^ self.value.textualRange
	}

	/// Set this to nil for tokens to use their default color.
    open func tokenBackgroundColor_qk_s(_ tokenBackgroundColor:  UIColor) -> QKC<AA,YY,ZZ, UIColor>{
		return link(next: tokenBackgroundColor).then_QK { $0.value.tokenBackgroundColor = tokenBackgroundColor }
	}
    open func tokenBackgroundColor_qk_g() -> QKC<AA,YY,ZZ, UIColor>{
		 self +^ self.value.tokenBackgroundColor
	}

	/// The application can always remove tokens programmatically. If this property is true, the application must be prepared not only for tokens to be removed, but also to be re-added through Undo. Defaults to true.
    open func allowsDeletingTokens_qk_s(_ allowsDeletingTokens:  Bool) -> QKC<AA,YY,ZZ, Bool>{
		return link(next: allowsDeletingTokens).then_QK { $0.value.allowsDeletingTokens = allowsDeletingTokens }
	}
    open func allowsDeletingTokens_qk_g() -> QKC<AA,YY,ZZ, Bool>{
		 self +^ self.value.allowsDeletingTokens
	}

	/// To support copying tokens, this property must be true and the delegate must provide an item provider for the tokens to be copied. UISearchTextField always enables the Copy command if any plain text is selected, even if the selection also includes tokens and this property is false. Defaults to true.
    open func allowsCopyingTokens_qk_s(_ allowsCopyingTokens:  Bool) -> QKC<AA,YY,ZZ, Bool>{
		return link(next: allowsCopyingTokens).then_QK { $0.value.allowsCopyingTokens = allowsCopyingTokens }
	}
    open func allowsCopyingTokens_qk_g() -> QKC<AA,YY,ZZ, Bool>{
		 self +^ self.value.allowsCopyingTokens
	}

    open func insertToken_qk_f(_ token: UISearchToken, at tokenIndex: Int) -> QKC<AA,YY,ZZ, UISearchToken>{
		 self +^ self.value.insertToken(token, at:tokenIndex) +^ token
	}

    open func removeToken_qk_f(at tokenIndex: Int) -> QKC<AA,YY,ZZ, Int>{
		 self +^ self.value.removeToken(at:tokenIndex) +^ tokenIndex
	}

	/// Returns the position of the provided token. To select a token, assign a UITextRange containing its position to the selectedTextRange property.
    open func positionOfToken_qk_f(at tokenIndex: Int) -> QKC<AA,YY,ZZ,UITextPosition>{
		 self +^ self.value.positionOfToken(at:tokenIndex)
	}

	/// You can use this method to determine which tokens are included in the user’s current selection. The range may span more than one token or a mixture of tokens and text.
    open func tokens_qk_f(in textRange: UITextRange) -> QKC<AA,YY,ZZ,[UISearchToken]>{
		 self +^ self.value.tokens(in:textRange)
	}

	/// Because this method does not remove any tokens in the provided range, the caller can pass the field’s selectedTextRange to convert the selected portion of the text into a token without first having to trim the range.
    open func replaceTextualPortion_qk_f(of textRange: UITextRange, with token: UISearchToken, at tokenIndex: Int) -> QKC<AA,YY,ZZ, UITextRange>{
		 self +^ self.value.replaceTextualPortion(of:textRange, with:token, at:tokenIndex) +^ textRange
	}

}

@available(iOS 13.0, *)
extension QKC where AA :UISearchToken {
	/// Because UISearchToken strongly references its representedObject, consider assigning a lightweight representation (such as NSManagedObjectID) instead of a complete model object to this property. The lifetime of a UISearchToken may be considerably longer than expected, especially if the token has been copied to a pasteboard.
    open func representedObject_qk_s(_ representedObject:  Any?) -> QKC<AA,YY,ZZ, Any?>{
		return link(next: representedObject).then_QK { $0.value.representedObject = representedObject }
	}
    open func representedObject_qk_g() -> QKC<AA,YY,ZZ, Any?>{
		 self +^ self.value.representedObject
	}

}

